// 刷新Token信息
const refreshTokenInfo = 'refreshToken'
// 访问令牌
const accessToken = 'access_token'

export function getRefreshToken() {
  return JSON.parse(localStorage.getItem(refreshTokenInfo))
}

export function setRefreshToken(refreshTokenObj) {
  return localStorage.setItem(refreshTokenInfo, JSON.stringify(refreshTokenObj))
}

export function removeRefreshToken() {
  return localStorage.removeItem(refreshTokenInfo)
}

export function getAccessToken() {
  return localStorage.getItem(accessToken)
}

export function setAccessToken(accessTokenStr) {
  return localStorage.setItem(accessToken, accessTokenStr)
}

export function removeAccessToken() {
  return localStorage.removeItem(accessToken)
}

export function removeAllLocalStorage() {
  localStorage.clear()
}
